#include "Avalon/IO/ConnectionState.hpp"

using namespace Avalon;
using namespace Avalon::IO;
using namespace boost;

ConnectionState::ConnectionState()
    : m_isOpen(false) {}

ConnectionState::~ConnectionState() {
  assert(!m_isOpen);
}

void ConnectionState::Initialize(bool isOpen) {
  assert(!m_isOpen);
  if(!isOpen) {
    return;
  }
  m_isOpen = true;
}

bool ConnectionState::IsOpen() const {
  return m_isOpen;
}

void ConnectionState::SetClosed() {
  m_isOpen = false;
}
